AGC033 D - Complexity
解答
code: python
h, w = map(int, input().split())
# 初期化
for i in range(h):
ok = [aij for j in range(w)] for k in range(w - 1, -1, -1):
if k != w - 1 and okk == okk+1: else:
for j in range(i + 1, h):
for k in range(w):
for k in range(w - 1, -1, -1):
if k != w - 1 and okk == okk+1: else:
for k in range(w):
ok = [aik for i in range(h)] for i in range(h - 1, -1, -1):
if i != h-1 and oki == oki+1: else:
for l in range(k + 1, w):
for i in range(h):
for i in range(h-1, -1, -1):
if i != h-1 and oki == oki+1: else:
# 更新
for ans in range(17):
exit(print(ans))
# dp1:たての切断の分を更新
# dp2:よこの切断の分を更新
# どちらもダブリングの要領で
for i in range(h):
for j in range(i, h):
for k in range(w):
if next_c < w:
for k in range(w):
for l in range(k,w):
for i in range(h):
if next_r < h:
# dp1:よこの切断の分を更新
# jについて単調性があるのでjごとに尺取り
for i in range(h):
for k in range(w):
l = k-1
for j in range(h-1, i-1, -1):
while l != w-1 and j <= dp2kl+1i: l += 1
# dp2:たての切断の分を更新
# lについて単調線があるのでlについて尺取り
for k in range(w):
for i in range(h):
j = i-1
for l in range(w-1, k-1 ,-1):
while j != h-1 and l <= dp1ij+1k: j += 1
テーマ
メモ
https://www.youtube.com/watch?v=Rr5ul_LDMiw
提出
code: python
h, w = map(int, input().split())
print(a)
# for i in range(2):
# O(pow(2, 184*2))